﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Lswweb.Model
{
    /// <summary>
    /// 实体类Users 。(属性说明自动提取数据库字段的描述信息)
    /// </summary>
    public class UserInfo
    {
        #region Model

        private int _id;
        private string _loginname;
        private string _password;
        private QuestionType _passwordquestion = QuestionType.Father;
        private string _passwordanswer;
        private string _email;
        private DateTime _datecreated;
        private DateTime _lastlogindate;
        private StatusType _status = StatusType.Enabled;

        /// <summary>
        /// 主键Id,自增列
        /// </summary>
        public int Id
        {
            set { _id = value; }
            get { return _id; }
        }
        /// <summary>
        /// 用户登录名
        /// </summary>
        public string LoginName
        {
            set { _loginname = value; }
            get { return _loginname; }
        }
        /// <summary>
        /// 密码
        /// </summary>
        public string Password
        {
            set { _password = value; }
            get { return _password; }
        }
        /// <summary>
        /// 会员密码提示问题序号，默认值，QuestionType.Father
        /// </summary>
        public QuestionType PasswordQuestion
        {
            set { _passwordquestion = value; }
            get { return _passwordquestion; }
        }
        /// <summary>
        /// 会员密码提示问题答案
        /// </summary>
        public string PasswordAnswer
        {
            set { _passwordanswer = value; }
            get { return _passwordanswer; }
        }
        /// <summary>
        /// 安全Email，很重要
        /// </summary>
        public string Email
        {
            set { _email = value; }
            get { return _email; }
        }
        /// <summary>
        /// 帐号建立时间
        /// </summary>
        public DateTime DateCreated
        {
            set { _datecreated = value; }
            get { return _datecreated; }
        }
        /// <summary>
        /// 最后登录时间
        /// </summary>
        public DateTime LastLoginDate
        {
            set { _lastlogindate = value; }
            get { return _lastlogindate; }
        }

        /// <summary>
        /// 会员状态 启用/禁用 默认值禁用
        /// </summary>
        public StatusType Status
        {
            set { _status = value; }
            get { return _status; }
        }

        public string Describes { get; set; }

        /// <summary>
        /// 会员是否为管理员
        /// </summary>
        public bool IsAdmin { get; set; }

        /// <summary>
        /// 管理员的权限， 多个权限之间用“|”号隔开 如： UserList|UserCreateEdit|NewsList 
        /// </summary>
        public string AdminPowers { get; set; }

        #endregion Model

        /// <summary>
        /// 用户资料
        /// </summary>
        public UserProfileInfo Profile { get; set; }
    }

    /// <summary>
    /// 实体类UserProfile 。(属性说明自动提取数据库字段的描述信息)
    /// </summary>
    public class UserProfileInfo
    {
        #region Model
        private int _userid;
        private string _name;
        private SexType _sex = SexType.Man;
        private string _mobile;
        private string _phone;
        private string _fax;
        private int _cityid;
        private string _street;
        private string _postcode;
        private string _companyname;
        /// <summary>
        /// 
        /// </summary>
        public int UserId
        {
            set { _userid = value; }
            get { return _userid; }
        }
        /// <summary>
        /// 姓名
        /// </summary>
        public string Name
        {
            set { _name = value; }
            get { return _name; }
        }
        /// <summary>
        /// 性别
        /// </summary>
        public SexType Sex
        {
            set { _sex = value; }
            get { return _sex; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string Mobile
        {
            set { _mobile = value; }
            get { return _mobile; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string Phone
        {
            set { _phone = value; }
            get { return _phone; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string Fax
        {
            set { _fax = value; }
            get { return _fax; }
        }
        /// <summary>
        /// 
        /// </summary>
        public int CityId
        {
            set { _cityid = value; }
            get { return _cityid; }
        }
        /// <summary>
        /// 街道
        /// </summary>
        public string Street
        {
            set { _street = value; }
            get { return _street; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string PostCode
        {
            set { _postcode = value; }
            get { return _postcode; }
        }
        /// <summary>
        /// 公司名
        /// </summary>
        public string CompanyName
        {
            set { _companyname = value; }
            get { return _companyname; }
        }

        #endregion Model
    }

    /// <summary>
    ///  密码提示问题
    /// </summary>
    public enum QuestionType
    {
        /// <summary>
        /// 出生地
        /// </summary>
        Homeplace = 0,

        /// <summary>
        /// 高中
        /// </summary>
        SeniorHighSchool = 1,

        /// <summary>
        /// 初中
        /// </summary>
        JuniorHighSchool = 2,

        /// <summary>
        /// 小学
        /// </summary>
        GradeSchool = 3,

        /// <summary>
        /// 父亲
        /// </summary>
        Father = 4,

        /// <summary>
        /// 父亲的生日
        /// </summary>
        FatherlyBirthday = 5,

        /// <summary>
        /// 母亲
        /// </summary>
        Mater = 6,

        /// <summary>
        /// 母亲的生日
        /// </summary>
        MatermalBirthday = 7,

        /// <summary>
        /// 你的序号 (工号/学号)
        /// </summary>
        YoursSerialNumber = 8,

        /// <summary>
        /// 你的生日
        /// </summary>
        YoursBirthday = 9,

        /// <summary>
        /// 你的职业
        /// </summary>
        YoursMetier = 10
    }

    /// <summary>
    /// 性别
    /// </summary>
    public enum SexType
    {
        /// <summary>
        /// 男
        /// </summary>
        Man = 0,

        /// <summary>
        /// 女
        /// </summary>
        WoMan = 1
    }

    /// <summary>
    /// 角色类型
    /// </summary>
    public enum RoleType
    {
        /// <summary>
        /// 匿名用户
        /// </summary>
        Guest = 0,

        /// <summary>
        /// 普通会员
        /// </summary>
        Member = 1,

        /// <summary>
        /// 管理员
        /// </summary>
        Admin = 2
    }
}
